document.getElementsByTagName("html")[0].style.fontSize = document.documentElement.clientWidth / 750 * 100 + "px";
window.onresize = function () {
    document.getElementsByTagName("html")[0].style.fontSize = document.documentElement.clientWidth / 750 * 100 + "px";
}


var xgs_popupTimeout;
xgs_popup = function ( k , obj ) {
    if(typeof obj == 'object'){
        var obj = obj;
        var k = k;
    }else{
        var obj = k;
        var k = 'open';
    }

    var target = $('#xgs_popup').size()?$('#xgs_popup'):function () {
        var obj = $('<div id="xgs_popup"><p></p></div>');
        $('body').append(obj);
        return obj;
    }();

    if( k != 'close'){
        var objTime = obj.time?obj.time : 2000;
        if(obj.text){
            target.find('p').html(obj.text)
        }

        var objW = target.width();
        var objH = target.height();
        var winW = $(window).width();
        var winH = $(window).height();

        target.css({
            left: (winW-objW)/2,
            top: (winH-objH)/2
        });

        target.fadeIn();

        if(objTime != 0){
            clearTimeout(xgs_popupTimeout);
            xgs_popupTimeout = setTimeout(function () {
                target.fadeOut(500);
            },objTime)
        }

    }else{
        target.fadeOut();
    }

}